package com.gticket.cinemauser.mapper;

import com.gticket.cinemauser.pojo.Perms;
import com.gticket.cinemauser.pojo.Role;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PermMapper {
    /**
     * 根据角色id查询权限
     * @param role role对象，需传入角色id、电影院名
     * @return List<Perms> 用户拥有的权限
     */
    @Select("select p.perm_id,p.operation,p.flag from " +
            "${databaseName}.perms p " +
            "where p.perm_id in (select perm_id from ${databaseName}.perm_role pr where pr.role_id = #{role_id}) " +
            "and flag = 0")
    List<Perms> selectPermsByRole_id(Role role);


}
